package com.edu.base.ums.appParameterBankAccount.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.edu.base.ums.appParameterBankAccount.domain.AppParameterBankAccount;
import com.edu.base.ums.appParameterBankAccount.service.IAppParameterBankAccountService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 提现银行账户Controller
 * 
 * @author luzs
 * @date 2021-06-07
 */
@RestController
@RequestMapping("/operation/appParameterBankAccount")
public class AppParameterBankAccountController extends BaseController
{
    @Autowired
    private IAppParameterBankAccountService appParameterBankAccountService;

    /**
     * 查询提现银行账户列表
     */
    @PreAuthorize("@ss.hasPermi('operation:appParameterBankAccount:list')")
    @GetMapping("/list")
    public TableDataInfo list(AppParameterBankAccount appParameterBankAccount)
    {
        startPage();
        List<AppParameterBankAccount> list = appParameterBankAccountService.selectAppParameterBankAccountList(appParameterBankAccount);
        return getDataTable(list);
    }

    /**
     * 导出提现银行账户列表
     */
    @PreAuthorize("@ss.hasPermi('operation:appParameterBankAccount:export')")
    @Log(title = "提现银行账户", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AppParameterBankAccount appParameterBankAccount)
    {
        List<AppParameterBankAccount> list = appParameterBankAccountService.selectAppParameterBankAccountList(appParameterBankAccount);
        ExcelUtil<AppParameterBankAccount> util = new ExcelUtil<AppParameterBankAccount>(AppParameterBankAccount.class);
        return util.exportExcel(list, "appParameterBankAccount");
    }

    /**
     * 获取提现银行账户详细信息
     */
    @PreAuthorize("@ss.hasPermi('operation:appParameterBankAccount:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(appParameterBankAccountService.selectAppParameterBankAccountById(id));
    }

    /**
     * 新增提现银行账户
     */
    @PreAuthorize("@ss.hasPermi('operation:appParameterBankAccount:add')")
    @Log(title = "提现银行账户", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AppParameterBankAccount appParameterBankAccount)
    {
        return toAjax(appParameterBankAccountService.insertAppParameterBankAccount(appParameterBankAccount));
    }

    /**
     * 修改提现银行账户
     */
    @PreAuthorize("@ss.hasPermi('operation:appParameterBankAccount:edit')")
    @Log(title = "提现银行账户", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AppParameterBankAccount appParameterBankAccount)
    {
        return toAjax(appParameterBankAccountService.updateAppParameterBankAccount(appParameterBankAccount));
    }

    /**
     * 删除提现银行账户
     */
    @PreAuthorize("@ss.hasPermi('operation:appParameterBankAccount:remove')")
    @Log(title = "提现银行账户", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(appParameterBankAccountService.deleteAppParameterBankAccountByIds(ids));
    }
}
